<%include file="include/head.html"%>
<div class="wrapper">
  <div id="div-home" class="main-info-box">
    <%include file="include/crumbs.html"%>
    <%include file="include/edit_nav.html"%>
    <div class="div-info-body">
      
      <!-- I was create these people, so add relation directly -->
      <%if $rel.creator eq $user.creator || $rel.open eq $FAMILY_OPEN_PUBLIC%>
      <form action="/relation/insert" method="post"> 
	<input type="hidden" name="userid" value="<%$user.id%>"/>
	<input type="hidden" name="user_name" value="<%$user.realname%>"/>
	<input type="hidden" name="rel_id" value="<%$rel.id%>"/>
	<input type="hidden" name="rel_name" value="<%$rel.realname%>"/>
	<dl>
          <dt><%$rel.realname%>是<%$user.realname%>的：
	    <select  required class="required" name="rel_type">
	      <%$rel_type%>
	    </select>
	  </dt>
	</dl>
        <dl>
          <dt>
	    <input type="submit" value="添加关系"/>
	    <a class="back" onclick="javascript :history.back(-1);return false" >返 回</a>
	  </dt>
        </dl>
	<!-- <button class="ym-button">确 定</button> -->
	<!-- <a class="back" onclick="javascript :history.back(-1); return false" 1class="ym-button">返 回</a> -->
      </form>
      <%else%>
      <!-- another people create the people, so request to add relation -->
      <form action="/relation/submit_request" method="post"> 
	<input type="hidden" name="userid" value="<%$user.id%>"/>
	<input type="hidden" name="user_name" value="<%$user.realname%>"/>
	<input type="hidden" name="rel_id" value="<%$rel.id%>"/>
	<input type="hidden" name="rel_name" value="<%$rel.realname%>"/>

	<dl>
          <dt><%$rel.realname%>是<%$user.realname%>的：
	    <select required class="required" name="rel_type">
	      <%$rel_type%>
	    </select>
	  </dt>
	</dl>
	<dl>
          <dt>验证信息：</dt>
          <dd><textarea name="message"></textarea></dd>
	</dl>
	
        <dl>
          <dt>
	    <input type="submit" value="发送"/>
	    <a class="back" onclick="javascript :history.back(-1);return false" 1class="ym-button">返 回</a>
	  </dt>
        </dl>
      </form>
      <%/if%>

    </div>
  </div>
</div>
<%include file="include/bottom.html"%>

